<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Tekdaqc Firmware: TelnetServer.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customstyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Tekdaqc Firmware
   &#160;<span id="projectnumber">1.0.2.0</span>
   </div>
   <div id="projectbrief">The firmware of the Tekdaqc.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_telnet_server_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">TelnetServer.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Implements a control interface for the Tekdaqc via the Telnet protocol.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="_tekdaqc___debug_8h_source.html">Tekdaqc_Debug.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_telnet_server_8h_source.html">TelnetServer.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_tekdaqc__config_8h_source.html">Tekdaqc_Config.h</a>&quot;</code><br/>
<code>#include &quot;stm32f4xx.h&quot;</code><br/>
<code>#include &quot;lwip/debug.h&quot;</code><br/>
<code>#include &quot;lwip/stats.h&quot;</code><br/>
<code>#include &quot;lwip/tcp.h&quot;</code><br/>
</div>
<p><a href="_telnet_server_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gae8002482499a83baab72c8714ef609d2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__telnet__server.html#gab6653d6c1bd1261ebfcb4d667f848716">TelnetStatus_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#gae8002482499a83baab72c8714ef609d2">InitializeTelnetServer</a> (void)</td></tr>
<tr class="memdesc:gae8002482499a83baab72c8714ef609d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize a <a class="el" href="struct_telnet_server__t.html" title="Data structure to hold the state of the Telnet server. Contains all of the necessary state variables ...">TelnetServer_t</a> struct with default values.  <a href="group__telnet__server.html#gae8002482499a83baab72c8714ef609d2">More...</a><br/></td></tr>
<tr class="separator:gae8002482499a83baab72c8714ef609d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga26f786d2e47e4bb5f180d2740eebc957"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga26f786d2e47e4bb5f180d2740eebc957">TelnetClose</a> (void)</td></tr>
<tr class="memdesc:ga26f786d2e47e4bb5f180d2740eebc957"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called when the the TCP connection should be closed.  <a href="group__telnet__server.html#ga26f786d2e47e4bb5f180d2740eebc957">More...</a><br/></td></tr>
<tr class="separator:ga26f786d2e47e4bb5f180d2740eebc957"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6509e0047d80aea0570ec903a1e10887"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__data__types.html#ga0ecf26b576b9a54eca656b9be7ba6a06">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga6509e0047d80aea0570ec903a1e10887">TelnetIsConnected</a> (void)</td></tr>
<tr class="memdesc:ga6509e0047d80aea0570ec903a1e10887"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates if the Telnet server is occupied or not.  <a href="group__telnet__server.html#ga6509e0047d80aea0570ec903a1e10887">More...</a><br/></td></tr>
<tr class="separator:ga6509e0047d80aea0570ec903a1e10887"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8946efc99077a959cb1cad3e059f9071"><td class="memItemLeft" align="right" valign="top">err_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga8946efc99077a959cb1cad3e059f9071">TelnetPoll</a> (void *arg, struct tcp_pcb *tpcb)</td></tr>
<tr class="memdesc:ga8946efc99077a959cb1cad3e059f9071"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the lwIP TCP/IP stack needs to poll the server with/for data.  <a href="group__telnet__server.html#ga8946efc99077a959cb1cad3e059f9071">More...</a><br/></td></tr>
<tr class="separator:ga8946efc99077a959cb1cad3e059f9071"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga93c1e298d9778f890b6df05b35072988"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga93c1e298d9778f890b6df05b35072988">TelnetRecvBufferWrite</a> (char character)</td></tr>
<tr class="memdesc:ga93c1e298d9778f890b6df05b35072988"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a character into the telnet receive buffer.  <a href="group__telnet__server.html#ga93c1e298d9778f890b6df05b35072988">More...</a><br/></td></tr>
<tr class="separator:ga93c1e298d9778f890b6df05b35072988"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff55b8914481cb32d621a855a69a5635"><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#gaff55b8914481cb32d621a855a69a5635">TelnetRead</a> (void)</td></tr>
<tr class="memdesc:gaff55b8914481cb32d621a855a69a5635"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a character from the telnet interface.  <a href="group__telnet__server.html#gaff55b8914481cb32d621a855a69a5635">More...</a><br/></td></tr>
<tr class="separator:gaff55b8914481cb32d621a855a69a5635"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa2f418e9d287a2863fe1198e3c75f4ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#gaa2f418e9d287a2863fe1198e3c75f4ad">TelnetWrite</a> (const char character)</td></tr>
<tr class="memdesc:gaa2f418e9d287a2863fe1198e3c75f4ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a character to the telnet interface.  <a href="group__telnet__server.html#gaa2f418e9d287a2863fe1198e3c75f4ad">More...</a><br/></td></tr>
<tr class="separator:gaa2f418e9d287a2863fe1198e3c75f4ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga579198334cf97874ecc89e3b29351066"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga579198334cf97874ecc89e3b29351066">TelnetWriteString</a> (char *string)</td></tr>
<tr class="memdesc:ga579198334cf97874ecc89e3b29351066"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a string to the telnet interface.  <a href="group__telnet__server.html#ga579198334cf97874ecc89e3b29351066">More...</a><br/></td></tr>
<tr class="separator:ga579198334cf97874ecc89e3b29351066"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8779bc1d2c7943063104c8624a877d8b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga8779bc1d2c7943063104c8624a877d8b">TelnetProcessWill</a> (char option)</td></tr>
<tr class="memdesc:ga8779bc1d2c7943063104c8624a877d8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle a WILL request for a telnet option.  <a href="group__telnet__server.html#ga8779bc1d2c7943063104c8624a877d8b">More...</a><br/></td></tr>
<tr class="separator:ga8779bc1d2c7943063104c8624a877d8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac84ea97f4be2d0b62498cca6297d0ab7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#gac84ea97f4be2d0b62498cca6297d0ab7">TelnetProcessWont</a> (char option)</td></tr>
<tr class="memdesc:gac84ea97f4be2d0b62498cca6297d0ab7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle a WONT request for a telnet option.  <a href="group__telnet__server.html#gac84ea97f4be2d0b62498cca6297d0ab7">More...</a><br/></td></tr>
<tr class="separator:gac84ea97f4be2d0b62498cca6297d0ab7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabdf9478794e09f61ab850c78147a7c6f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#gabdf9478794e09f61ab850c78147a7c6f">TelnetProcessDo</a> (char option)</td></tr>
<tr class="memdesc:gabdf9478794e09f61ab850c78147a7c6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle a DO request for a telnet option.  <a href="group__telnet__server.html#gabdf9478794e09f61ab850c78147a7c6f">More...</a><br/></td></tr>
<tr class="separator:gabdf9478794e09f61ab850c78147a7c6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf2500a4ad4bcbfd6ac4367f298e42f10"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#gaf2500a4ad4bcbfd6ac4367f298e42f10">TelnetProcessDont</a> (char option)</td></tr>
<tr class="memdesc:gaf2500a4ad4bcbfd6ac4367f298e42f10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle a DONT request for a telnet option.  <a href="group__telnet__server.html#gaf2500a4ad4bcbfd6ac4367f298e42f10">More...</a><br/></td></tr>
<tr class="separator:gaf2500a4ad4bcbfd6ac4367f298e42f10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga348f2b04116a013b6eabfa72c926a25f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga348f2b04116a013b6eabfa72c926a25f"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga348f2b04116a013b6eabfa72c926a25f">TelnetProcessCharacter</a> (char character)</td></tr>
<tr class="memdesc:ga348f2b04116a013b6eabfa72c926a25f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process a character received from the telnet port. <br/></td></tr>
<tr class="separator:ga348f2b04116a013b6eabfa72c926a25f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0660c325387baca6c54fe699ac048907"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga0660c325387baca6c54fe699ac048907">TelnetWriteErrorMessage</a> (char *message)</td></tr>
<tr class="memdesc:ga0660c325387baca6c54fe699ac048907"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print a message to the telnet connection formatted as an error.  <a href="group__telnet__server.html#ga0660c325387baca6c54fe699ac048907">More...</a><br/></td></tr>
<tr class="separator:ga0660c325387baca6c54fe699ac048907"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0afb5de5ce2d81cdc5322e0534bae1d8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga0afb5de5ce2d81cdc5322e0534bae1d8">TelnetWriteStatusMessage</a> (char *message)</td></tr>
<tr class="memdesc:ga0afb5de5ce2d81cdc5322e0534bae1d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print a message to the telnet connection formatted as a status.  <a href="group__telnet__server.html#ga0afb5de5ce2d81cdc5322e0534bae1d8">More...</a><br/></td></tr>
<tr class="separator:ga0afb5de5ce2d81cdc5322e0534bae1d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7d350b6355ef213d4aa15e9b80c3d15e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga7d350b6355ef213d4aa15e9b80c3d15e">TelnetWriteDebugMessage</a> (char *message)</td></tr>
<tr class="memdesc:ga7d350b6355ef213d4aa15e9b80c3d15e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print a message to the telnet connection formatted as a debug.  <a href="group__telnet__server.html#ga7d350b6355ef213d4aa15e9b80c3d15e">More...</a><br/></td></tr>
<tr class="separator:ga7d350b6355ef213d4aa15e9b80c3d15e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7f3d87d181908e8353a67bbaf15fac50"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__telnet__server.html#ga7f3d87d181908e8353a67bbaf15fac50">TelnetWriteCommandDataMessage</a> (char *message)</td></tr>
<tr class="memdesc:ga7f3d87d181908e8353a67bbaf15fac50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print a message to the telnet connection formatted as a command data message.  <a href="group__telnet__server.html#ga7f3d87d181908e8353a67bbaf15fac50">More...</a><br/></td></tr>
<tr class="separator:ga7f3d87d181908e8353a67bbaf15fac50"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implements a control interface for the Tekdaqc via the Telnet protocol. Only a single connection is allowed at a time. Any attempts to connect while an active connection is present will result in an error message from the board.</p>
<p>This file based on the Telnet server implementation in the TI Stellaris example Cave Adventure game, in particular, the methods for processing the Telnet state machine.</p>
<dl class="section author"><dt>Author</dt><dd>Jared Woolston (<a href="#" onclick="location.href='mai'+'lto:'+'jwo'+'ol'+'sto'+'n@'+'ten'+'ki'+'v.c'+'om'; return false;">jwool<span style="display: none;">.nosp@m.</span>ston<span style="display: none;">.nosp@m.</span>@tenk<span style="display: none;">.nosp@m.</span>iv.c<span style="display: none;">.nosp@m.</span>om</a>) </dd></dl>
<dl class="section since"><dt>Since</dt><dd>v1.0.0.0 </dd></dl>

<p>Definition in file <a class="el" href="_telnet_server_8c_source.html">TelnetServer.c</a>.</p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_da411aab950102a7c87084f4501853eb.html">TekDAQC_Libraries_Firmware</a></li><li class="navelem"><a class="el" href="dir_802ae1d07bfa9b99d65804b276995b48.html">src</a></li><li class="navelem"><a class="el" href="_telnet_server_8c.html">TelnetServer.c</a></li>
    <li class="footer">Generated on Mon Jul 28 2014 23:42:41 for Tekdaqc Firmware by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
